/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import java.util.Map;
import org.apache.struts2.interceptor.ParameterAware;
import org.apache.struts2.interceptor.SessionAware;

/**
 *
 * @author Sebastien
 */
public class AbstractPage extends ActionSupport implements SessionAware, ParameterAware {

    protected String message;
    protected String dataToPrint;
    protected String xslPath;
    protected String action;

    private Map parameters;
    private Map session = ActionContext.getContext().getSession();
    public static final String defaultPage = "welcome.jsp";
    protected String page = "";

    public String getDataToPrint() {
        return dataToPrint;
    }

    public void setDataToPrint(String dataToPrint) {
        this.dataToPrint = dataToPrint;
    }

    public String getXslPath() {
        return xslPath;
    }

    public void setXslPath(String xslPath) {
        this.xslPath = xslPath;
    }

    public String getPage() {
        return page.equals("") ? AbstractPage.defaultPage : page;
    }

    public void setPage(String p) {
        this.page = p;
    }
    
    public String getMessage() {
        return message;
    }

    public Map getParameters() {
        return parameters;
    }

    public void setParameters(Map param) {
        this.parameters = param;
    }

    public Map getSession() {
        return session;
    }

    public void setSession(Map session) {
        this.session = session;
    }
    
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Override
    public String execute() throws Exception {
        message = "Abstract";

        return SUCCESS;
    }
}
